#include <iostream>
#include "DraggedEgg.h"

using namespace std;

int DraggedEgg :: count = 0;
DraggedEgg* DraggedEgg :: draggedEgg[EGG_LIMIT];

DraggedEgg :: DraggedEgg()
{
	if(count >= EGG_LIMIT)
	{
		cerr << "[Error]: the EGG_LIMIT of draggedEgg is too small!" << endl;
		exit(1);
	}

	draggedEgg[count++] = this;
};

DraggedEgg :: ~DraggedEgg()
{
	for(int i = 0; i < count; i++)
	{
		if(draggedEgg[i] == this)
			draggedEgg[i] = draggedEgg[--count];
	}
}